<script type="text/javascript">
    function showReport(url){
        //untuk mengisi parameter ke iReport formatnya adalah 
        //namaParameter1->isi,namaParameter2->isi,
        //paling akhir harus diberikan tanda koma (,) agar semua parameter bisa terbaca.
        var p = 'RegistrationID->'+<?php echo $model->RegistrationID; ?>+',';
        myWindow=window.open(url+'&p='+p,'','directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,width=820,height=612');
        myWindow.focus();
    }
</script>
<?php
/* @var $this OdsregistrationformController */
/* @var $model Odsregistrationform */

$this->breadcrumbs=array(
	'Odsregistrationforms'=>array('index'),
	$model->RegistrationID,
);

$this->menu=array(
	array('label'=>'List Odsregistrationform', 'url'=>array('index')),
	array('label'=>'Create Odsregistrationform', 'url'=>array('create')),
        array('label'=>'Update Odsregistrationform', 'url'=>array('update', 'RegistrationID'=>$model->RegistrationID)),
        array('label'=>'Delete Odsregistrationform', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','RegistrationID'=>$model->RegistrationID),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Odsregistrationform', 'url'=>array('admin')),
);
?>

<h1>View Odsregistrationform #<?php echo $model->RegistrationID ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		array('label'=>'No Resi','name'=>'RegistrationID'),
		array('label'=>'Tanggal Paket','name'=>'RegistrationDate'),
		array('label'=>'Nama Pengirim','name'=>'shipperHuman.Name'),
                array('label'=>'Alamat pengirim','value'=> ShipperHumanAttribute::model()->find("HumanID = '{$model->ShipperHumanID}' and isActive = 1")->Address),
                array('label'=>'Kode Pos','value'=> ShipperHumanAttribute::model()->find("HumanID = '{$model->ShipperHumanID}' and isActive = 1")->addressLocation->ZipCode),
                array('label'=>'Telepon','value'=> ShipperHumanAttribute::model()->find("HumanID = '{$model->ShipperHumanID}' and isActive = 1")->PhoneNumber),
                array('label'=>'Kota Asal','value'=> ShipperHumanAttribute::model()->find("HumanID = '{$model->ShipperHumanID}' and isActive = 1")->addressLocation->regency->RegencyName),
		array('label'=>'Nama Penerima','name'=>'shipperHuman.Name'),
                array('label'=>'Alamat Penerima','value'=> ReceiverHumanAttribute::model()->find("HumanID = '{$model->ReceiverHumanID}' and isActive = 1")->Address),
                array('label'=>'Kode Pos','value'=> ReceiverHumanAttribute::model()->find("HumanID = '{$model->ReceiverHumanID}' and isActive = 1")->addressLocation->ZipCode),
                array('label'=>'Telepon','value'=> ReceiverHumanAttribute::model()->find("HumanID = '{$model->ReceiverHumanID}' and isActive = 1")->PhoneNumber),
                array('label'=>'Kota Tujuan','value'=> ReceiverHumanAttribute::model()->find("HumanID = '{$model->ReceiverHumanID}' and isActive = 1")->addressLocation->regency->RegencyName),
		array('label'=>'Type Pengiriman','name'=>'itemShippingType.ItemShippingTypeName'),
                array('label'=>'Type Packing','name'=>'itemPacking.PackingName'),
		array('label'=>'Koli', 'name'=>'TotalItemsDetail'),
		array('label'=>'Asuransi', 'name'=>'insuranceNumber.InsuranceName'),
		array('label'=>'Type Pembayaran', 'name'=>'paymentType.PaymentTypeName'),
		//'ShippingDistance',
                array('label'=>'Biaya Kirim','name'=>'itemShippingType.Cost'),
                array('label'=>'Biaya Packing','name'=>'itemPacking.PackingCost'),
                array('label'=>'Biaya Lain-Lain', 'name'=>'OtherFee'),
                array('label'=>'Biaya Asuransi', 'name'=>'insuranceNumber.InsuranceCost'),
                array('label'=>'Biaya Adm. Asuransi', 'name'=>'insuranceNumber.AdministrationFee'),
		//array('label'=>'Biaya Administrasi', 'name'=>'AdministrationFee'),
		//array('label'=>'Pajak', 'name'=>'TaxAmount'),
		array('label'=>'Total Biaya', 'name'=>'TotalAmount'),
//		'isActive',
//		'CreatedBy',
//		'CreatedOn',
//		'LastUpdateBy',
//		'LastUpdateOn',
	),
)); ?>

<?php //untuk URL Reportnya bisa arahkan ke r=appReport&file=reportLatihan&p=namaParameter1->isi,namaParameter2->isi, ?>
            <input type="button" onClick="showReport('<?php echo Yii::app()->getBaseURL(); ?>/index.php/appReport?file=LapRegistrationForm')" value="Show Report">


